Don't use the same name for a function that used to be a variable
authorTor Lillqvist <tml@iki.fi>
Thu, 9 Sep 2010 08:03:22 +0000 (11:03 +0300)
committerTor Lillqvist <tml@iki.fi>
Thu, 9 Sep 2010 08:06:26 +0000 (11:06 +0300)
Rename the gtk_major_version() etc functions I introduced yesterday to
start with gtk_get. Avoids misleading results in client programs whose
developers that don't notice the change or the compiler warnings, and
when recompiling against gtk3 then use the function addresses as the
version numbers.

demos/gtk-demo/appwindow.c
gtk/gtk.symbols
gtk/gtkmain.c
gtk/gtkmain.h
tests/testgtk.c

index 2953bb8a012eaf67b289d0f94c9512ed4fa69129..a3bbf4794cf26f15698b0b608e58e6aa7faf7915 100644 (file)
@@ -126,9 +126,9 @@ about_cb (GtkAction *action,
                         "program-name", "GTK+ Code Demos",
                         "version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
                                                     PACKAGE_VERSION,
-                                                    gtk_major_version (),
-                                                    gtk_minor_version (),
-                                                    gtk_micro_version ()),
+                                                    gtk_get_major_version (),
+                                                    gtk_get_minor_version (),
+                                                    gtk_get_micro_version ()),
                         "copyright", "(C) 1997-2009 The GTK+ Team",
                         "license-type", GTK_LICENSE_LGPL_2_1,
                         "website", "http://www.gtk.org",
index 36ef63278d66d5145ed2fd99ae680f8fc064c364..a89347d20714783d01c46ebccebee3f5b1de82e5 100644 (file)
@@ -1853,11 +1853,11 @@ gtk_events_pending
 gtk_disable_setlocale
 gtk_distribute_natural_allocation
 gtk_set_locale
-gtk_binary_age
-gtk_interface_age
-gtk_major_version
-gtk_minor_version
-gtk_micro_version
+gtk_get_major_version
+gtk_get_minor_version
+gtk_get_micro_version
+gtk_get_binary_age
+gtk_get_interface_age
 gtk_check_version
 gtk_get_default_language
 gtk_get_event_widget
index 03f33c6946f708cd3de62807e9ad85938771129f..6d9eca5a7fce31a3ecb9045a112d07d0fa851166 100644 (file)
@@ -213,7 +213,7 @@ static const GDebugKey gtk_debug_keys[] = {
 #endif /* G_ENABLE_DEBUG */
 
 /**
- * gtk_major_version:
+ * gtk_get_major_version:
  *
  * Returns the major version number of the GTK+ library.  (e.g. in GTK+ version
  * 3.1.5 this is 3.) 
@@ -223,16 +223,18 @@ static const GDebugKey gtk_debug_keys[] = {
  * macro, which represents the major version of the GTK+ headers you
  * have included when compiling your code.
  *
- * Returns the major version number of the GTK+ library.
+ * Returns: the major version number of the GTK+ library.
+ *
+ * Since: 3.0
  */
 guint
-gtk_major_version (void)
+gtk_get_major_version (void)
 {
   return GTK_MAJOR_VERSION;
 }
 
 /**
- * gtk_minor_version:
+ * gtk_get_minor_version:
  *
  * Returns the minor version number of the GTK+ library.  (e.g. in GTK+ version
  * 3.1.5 this is 1.) 
@@ -242,16 +244,18 @@ gtk_major_version (void)
  * #GTK_MINOR_VERSION macro, which represents the minor version of the
  * GTK+ headers you have included when compiling your code.
  *
- * Returns the minor version number of the GTK+ library.
+ * Returns: the minor version number of the GTK+ library.
+ *
+ * Since: 3.0
  */
 guint
-gtk_minor_version (void)
+gtk_get_minor_version (void)
 {
   return GTK_MINOR_VERSION;
 }
 
 /**
- * gtk_micro_version:
+ * gtk_get_micro_version:
  *
  * Returns the micro version number of the GTK+ library.  (e.g. in GTK+ version
  * 3.1.5 this is 5.) 
@@ -261,16 +265,18 @@ gtk_minor_version (void)
  * #GTK_MICRO_VERSION macro, which represents the micro version of the
  * GTK+ headers you have included when compiling your code.
  *
- * Returns the micro version number of the GTK+ library.
+ * Returns: the micro version number of the GTK+ library.
+ *
+ * Since: 3.0
  */
 guint
-gtk_micro_version (void)
+gtk_get_micro_version (void)
 {
   return GTK_MICRO_VERSION;
 }
 
 /**
- * gtk_binary_age:
+ * gtk_get_binary_age:
  *
  * Returns the binary age as passed to
  * <application>libtool</application> when building the GTK+ library
@@ -278,16 +284,18 @@ gtk_micro_version (void)
  * <application>libtool</application> means nothing to you, don't
  * worry about it.
  *
- * Returns the binary age of the GTK+ library.
+ * Returns: the binary age of the GTK+ library.
+ *
+ * Since: 3.0
  */
 guint
-gtk_binary_age (void)
+gtk_get_binary_age (void)
 {
   return GTK_BINARY_AGE;
 }
 
 /**
- * gtk_interface_age:
+ * gtk_get_interface_age:
  *
  * Returns the interface age as passed to
  * <application>libtool</application> when building the GTK+ library
@@ -295,10 +303,12 @@ gtk_binary_age (void)
  * <application>libtool</application> means nothing to you, don't
  * worry about it.
  *
- * Returns the interface age of the GTK+ library.
+ * Returns: the interface age of the GTK+ library.
+ *
+ * Since: 3.0
  */
 guint
-gtk_interface_age (void)
+gtk_get_interface_age (void)
 {
   return GTK_INTERFACE_AGE;
 }
index ca7bd669d77275f4c8c8e974a21e2f794d322a84..39171f584847b3998596fa43899ba11173c6622b 100644 (file)
@@ -51,11 +51,17 @@ typedef gint        (*GtkKeySnoopFunc)          (GtkWidget    *grab_widget,
 
 /* Gtk version.
  */
-guint gtk_major_version (void) G_GNUC_CONST;
-guint gtk_minor_version (void) G_GNUC_CONST;
-guint gtk_micro_version (void) G_GNUC_CONST;
-guint gtk_binary_age    (void) G_GNUC_CONST;
-guint gtk_interface_age (void) G_GNUC_CONST;
+guint gtk_get_major_version (void) G_GNUC_CONST;
+guint gtk_get_minor_version (void) G_GNUC_CONST;
+guint gtk_get_micro_version (void) G_GNUC_CONST;
+guint gtk_get_binary_age    (void) G_GNUC_CONST;
+guint gtk_get_interface_age (void) G_GNUC_CONST;
+
+#define gtk_major_version gtk_get_major_version ()
+#define gtk_minor_version gtk_get_minor_version ()
+#define gtk_micro_version gtk_get_micro_version ()
+#define gtk_binary_age gtk_get_binary_age ()
+#define gtk_interface_age gtk_get_interface_age ()
 
 const gchar* gtk_check_version (guint  required_major,
                                guint   required_minor,
index 8d408b31238e991d3adb0b274bc638ca0860588d..6f0bf104fcad8ef7404df8faca62ec9b6c6c0739 100644 (file)
@@ -10333,14 +10333,14 @@ create_main_window (void)
   if (gtk_micro_version > 0)
     sprintf (buffer,
             "Gtk+ v%d.%d.%d",
-            gtk_major_version (),
-            gtk_minor_version (),
-            gtk_micro_version ());
+            gtk_get_major_version (),
+            gtk_get_minor_version (),
+            gtk_get_micro_version ());
   else
     sprintf (buffer,
             "Gtk+ v%d.%d",
-            gtk_major_version (),
-            gtk_minor_version ());
+            gtk_get_major_version (),
+            gtk_get_minor_version ());
 
   label = gtk_label_new (buffer);
   gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 0);